﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Spanner
{
    public abstract class AttrExpr
    {
        internal abstract void Write(Context ctxt, JSorHtml what);
    }

    internal class SimpleAttrExpr : AttrExpr
    {
        internal object Value;

        internal override void Write(Context ctxt, JSorHtml what)
        {
            ctxt.Write(Value.ToString());
        }
    }

    internal class DataBindExpr : AttrExpr
    {
        internal string DataBindKey;
        internal ITerm DataBindValue;

        internal override void Write(Context ctxt, JSorHtml what)
        {
            ctxt.Write(DataBindKey);
            ctxt.Write(": ");
            DataBindValue.Write(ctxt, what);
        }
    }
}
